<?php if (!defined('BASEPATH')) exit('No direct script access allowed');


class Users_model extends MY_Model {

    protected $user;

    /**
     * [__construct description]
     */
    function __construct() {
        parent::__construct();
    }

    function table_name() {
        return "users";
    }

    function checkExistUser($id = '') {
    	$this->db->where('id', $id);
        $query  = $this->db->get('users');
        if($query->row()) {
            return TRUE;
        } else {
            return FALSE;
        }
    }

    function getUser($id = '') {
    	$this->db->where('id', $id);
        $query  = $this->db->get('users');

        if($query->row()) {
        	$array = $query->result_array();
            return $array[0];
        } else {
            return FALSE;
        }
    }

    function insert_users($data) {
        $dish_id = $this->save($data);
        return $dish_id;
    }
}